package com.aspose.cells;

import java.util.ArrayList;

final class zaua {
   static void a(zig var0, com.aspose.cells.b.a.b.zp[] var1, zbcq var2) throws Exception {
      if (var1[0].e() > 0 && var1[0].f() > 0) {
         if (var0.N() == 45 || var0.N() == 48) {
            if (var0.B().s()) {
               byte var3 = 4;
               var1[0].a(var1[0].c() + var3);
               var1[0].b(var1[0].d() + var3);
               var1[0].c(var1[0].e() - 2 * var3);
               var1[0].d(var1[0].f() - 2 * var3);
               if (var2.aw() && (var2.w().j() == 4 || var2.w().j() == 0)) {
                  int var4 = zbuk.a((double)((float)var0.a() / 100.0F * 6.0F));
                  int var5 = zbuk.a((double)((float)var0.b() / 100.0F * 6.0F));
                  var1[0].a(var1[0].c() + var4);
                  var1[0].b(var1[0].d() + var5);
                  var1[0].c(var1[0].e() - 2 * var4);
                  var1[0].d(var1[0].f() - 2 * var5);
               }
            }

         }
      }
   }

   private static void a(com.aspose.cells.b.a.b.zp[] var0, zig var1) {
      int var2 = zbuk.a((double)((float)var0[0].e() / 400.0F * 3.0F));
      int var3 = zbuk.a((double)((float)var0[0].f() / 400.0F * 3.0F));
      var0[0].a(var0[0].c() + var2);
      var0[0].b(var0[0].d() + var3);
      var0[0].c(var0[0].e() - 2 * var2);
      var0[0].d(var0[0].f() - 2 * var3);
      double var4 = 0.1428571492433548D / Math.cos(0.17453292519943295D);
      double var6 = (double)var1.p() * 3.141592653589793D / 180.0D;
      double var8 = (double)var0[0].e() * (Math.sin(var6) + var4 * (double)var1.q() / 100.0D * Math.cos(var6));
      double var10 = (double)var0[0].f() / (Math.sin(var6) + var4 * (double)var1.q() / 100.0D * Math.cos(var6));
      if (var8 <= (double)var0[0].f()) {
         var0[0].b(zbuk.c((double)((float)var0[0].d() + (float)var0[0].f() / 2.0F) - var8 / 2.0D));
         var0[0].d(zbuk.c(var8));
      } else {
         var0[0].a(zbuk.c((double)((float)var0[0].c() + (float)var0[0].e() / 2.0F) - var10 / 2.0D));
         var0[0].c(zbuk.c(var10));
      }

      double var12 = (double)var0[0].e() * var4 * (double)var1.q() / 100.0D * Math.cos(var6);
      double var14 = var12 / (double)var0[0].f();
      var1.a((float)var14);
   }

   static void a(zn var0, zig var1) throws Exception {
      zbcq var2 = (zbcq)((zbcq)var1.z().j().get(0));
      zjg var3 = var2.E();
      Color[] var4 = new Color[var3.getCount()];
      Color[] var5 = var1.Z().a().a(var1.R(), var3.getCount());

      for(int var6 = 0; var6 < var3.getCount(); ++var6) {
         zje var7 = var3.b(var6);
         if (var2.I()) {
            var7.i().c(var5[var6]);
         } else {
            var7.i().c(var2.A().f());
         }

         var4[var6] = var7.i().f();
      }

      double[] var19 = new double[var3.getCount()];

      for(int var20 = 0; var20 < var3.getCount(); ++var20) {
         zje var8 = var3.b(var20);
         var19[var20] = Math.abs(var8.v());
      }

      String[] var21 = new String[var3.getCount()];
      double var22 = 0.0D;

      int var10;
      for(var10 = 0; var10 < var3.getCount(); ++var10) {
         var22 += Math.abs(var3.a(var10).v());
      }

      if (var22 != 0.0D) {
         for(var10 = 0; var10 < var3.getCount(); ++var10) {
            zje var11 = var3.b(var10);
            double var12 = Math.abs(var11.v());
            double var14 = 0.0D;
            if (var22 != 0.0D) {
               var14 = var12 / var22;
            }

            var21[var10] = a(var2, var10, var14);
         }

         com.aspose.cells.b.a.b.zp var23 = var1.B().b;
         com.aspose.cells.b.a.b.zp[] var24 = new com.aspose.cells.b.a.b.zp[]{var23};
         a(var24, var1);
         var23 = var24[0];
         com.aspose.cells.b.a.b.a.zf var25 = var0.e();
         var0.a(4);
         zauc var13 = new zauc((float)var23.c(), (float)var23.d(), (float)var23.e(), (float)var23.f(), var19, var4, var1.ah(), var21, var3);

         try {
            var13.a(var2);
            var13.a(var0);
            var13.a(var0, var2);
         } finally {
            if (var13 != null) {
               var13.b();
            }

         }

         var0.a(var25);
      }
   }

   private static String a(zbcq var0, int var1, double var2) {
      zig var4 = var0.v();
      zje var5 = var0.E().b(var1);
      ArrayList var6 = var4.z().c();
      zbp var7 = var4.e();
      zpu var8 = var5.o();
      boolean var9 = var8.r();
      boolean var10 = var8.q();
      String var11 = var8.f() ? "" : var8.p();
      String var12 = "".equals(var8.p()) ? "0%" : var8.p();
      String var13 = var0.i();
      String var14 = var1 < var7.l.size() ? zpw.a(var4.al(), var7.l.get(var1), var11, var9) : "";
      String var15;
      if (var10) {
         var15 = var1 >= 0 && var1 < var6.size() ? ((zfp)var6.get(var1)).c() : "";
         boolean var16 = var1 >= 0 && var1 < var6.size() ? ((zfp)var6.get(var1)).b() : false;
         var14 = var1 >= 0 && var1 < var7.l.size() ? zpw.a(var4.al(), var7.l.get(var1), var15, var16) : "";
      }

      var15 = zpw.a(var4.al(), var5.v(), var11, var9);
      if (var10) {
         var15 = zpw.a(var4.al(), var5.v(), var5.z(), var5.A());
      }

      String var23 = zpw.a(var4.al(), var2, var12, var9);
      String var17 = var8.l();
      com.aspose.cells.b.a.b.zg var18 = var8.a().h();
      int var19 = var8.m();
      int var20 = var8.n();
      int var21 = var8.o();
      String var22 = "";
      if (var8.h()) {
         var22 = var22 + var13;
      }

      if (var8.d()) {
         if (!"".equals(var22)) {
            var22 = var22 + var17;
         }

         var22 = var22 + var14;
      }

      if (var8.g()) {
         if (!"".equals(var22)) {
            var22 = var22 + var17;
         }

         var22 = var22 + var15;
      }

      if (var8.f()) {
         if (!"".equals(var22)) {
            var22 = var22 + var17;
         }

         var22 = var22 + var23;
      }

      return var22;
   }
}
